import { computed } from 'vue';
import { hasPermission, hasGraphPermission } from '@/utils/permission';

export const permissionsMixin = {
  setup() {
    const permissionStatus = computed(() => {
      return {
        base: hasPermission('graph:view'),
        supplyChain: hasPermission('analysis:supply-chain'),
        industryChain: hasPermission('analysis:industry-chain'),
        companyRisk: hasPermission('analysis:company-risk'),
        highTech: hasPermission('analysis:high-tech'),
        productChain: hasPermission('analysis:product-chain'),
        companyStats: hasPermission('analysis:company-stats')
      };
    });

    return { permissionStatus, hasPermission, hasGraphPermission };
  }
}; 